package com.pp.common;

import lombok.Data;

import java.io.Serializable;
@Data
public class BaseResponse<T> implements Serializable {
    private static final  long  SerializableVersionId=3253252363426l;
    private Integer  code;
    private T data;
    private String message;

    private String description;


    public BaseResponse(Integer code, T data, String message, String description) {
        this.code = code;
        this.data = data;
        this.message = message;
        this.description = description;
    }

    public BaseResponse(Integer code, T data, String message) {
      this(code ,data,message,"");
    }

    public BaseResponse(Integer code, T data) {
        this(code ,data,"","");
    }
    //返回错误的
    public BaseResponse(ErrorCode errorCode){
        this(errorCode.getCode(),null,errorCode.getMessage(),errorCode.getDescription());
    }
}
